<template lang="html">
  <div class="bars">
    <div :class="['bar',{'menu-active':hotShow}]" @click="ShowHot">
      <router-link to="/hotmusic">热歌榜</router-link>
      <i></i><span class="gap-line"> </span>
    </div>
    <div :class="['bar',{'menu-active':newShow}]" @click="ShowNew">
      <router-link to="/newmusic">新歌榜</router-link>
      <i></i><span class="gap-line"> </span>
    </div>
    <div :class="['bar',{'menu-active':fashShow}]" @click="ShowFash">
      <router-link to="/fashionmusic">流行榜</router-link>
      <i></i>
    </div>
  </div>
</template>

<script>
export default {
  name:"MusicNav",
  data(){
    return{
      hotShow:true,
      newShow:false,
      fashShow:false
    }
  },
  methods:{
    ShowHot(){
      this.hotShow=true;
      this.newShow=false;
      this.fashShow=false;
    },
    ShowNew(){
      this.hotShow=false;
      this.newShow=true;
      this.fashShow=false;
    },
    ShowFash(){
      this.hotShow=false;
      this.newShow=false;
      this.fashShow=true;
    }
  }
}
</script>

<style scoped>
.bars{
  display: flex;
  background-color: white;
  border-top: 0.06rem solid lightgray;
  height: 1.2rem;
}
.bars .menu-active{
	border-bottom:0.05rem solid #c995f5;
  color: #c995f5;
}
.bars div{
    color: black;
    font-weight: bold;
    padding: 0.18rem 0 0.12rem 0;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    text-align: center;
    margin-top: 0.3rem;
    color: #999;
    position: relative;
    z-index: 2;
}
.bars .bar .gap-line {
    position: absolute;
    right: 0;
    top: 0.2rem;
    height: 0.18rem;
    width: 0.01rem;
    border-left: 0.01rem solid #eee;
}

</style>
